<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="java.util.*" %>
<%@ page import="com.jjh.search.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>搜索界面</title>
</head>
<body>
	<form id="searcheForm" action="SearchController">
		<table>
			<tbody>
				<tr>
					<td colspan="3">
						<input name="searchWord" id="searchWord" type="text" size="40">
						<input id="doSearch" type="submit" value="search">
					</td>
				</tr>
				<%
					List searchResult = (List)request.getAttribute("searchResult");
					int resultCount = 0;
					if(searchResult != null){
						resultCount = searchResult.size();
					}
					for(int i = 0; i < resultCount; i ++){
						SearchResult result = (SearchResult) searchResult.get(i);
						String title = result.getHtmlTitle();
						String path = result.getHtmlPath();
				%>
				<tr>
					<td>
						<a href="<%=path%>"><%=title %></a>
					</td>
				</tr>
				<%
					}
					
				%>
			</tbody>
		</table>
	</form>
</body>
</html>